import Vue from "vue"
import Vuex from "vuex"

import cart from "@/store/modules/cart.js"
import path from "@/store/modules/path.js"
import user from "@/store/modules/user.js"
import category from "@/store/modules/category.js"
import sku from "@/store/modules/sku.js"
import Config from '@/utils/config.js'

Vue.use(Vuex)

export default new Vuex.Store({
	state:{
		// 网络图片地址
		PageCur: 'home',
		imgUrl: Config.http + Config.hostName + '/assets',
		Refresh: false,
	},
	mutations: {
		NavChange(state, name) {
			state.PageCur = name
		},
		refreshChange(state, b) {
			state.Refresh = b
			// console.log(state.Refresh)
		}
	},
	modules:{
		cart,
		path,
		user,
		category,
		sku
	}
})